#-*- coding: utf8 -*-
from tutor.scripts import *
from tutor.plugins.maple import *
sqrt = M('sqrt')

n_iter = 0
while True:
    with display_block('Parâmetros'):
        a, b = oneof((3, 4), (6, 8), (5, 12), (1, 2), (2, 3), (2, 2), (1, 3))
        if oneof(True, False):
            a, b = b, a
        Fx = a * sin(t) - a * t * cos(t)
        Fy = a * cos(t) + a * t * sin(t)
        Fz = b * t ** 2

    with display_block('Resultados'):
        L = sqrt(a ** 2 + 4 * b ** 2) * Pi ** 2 / 2
        L2 = 4 * L

        Lnz = M(1) / 2 * a * Pi ** 2
        Lnz2 = 4 * Lnz

        Lflat = -2 * a + a * Pi + b * Pi ** 2
        Lflat2 = 4 * b * Pi ** 2 - 2 * a * Pi

        L2half = L2 / 2

        Lnz2half = Lnz2 / 2
        LnzTwice = Lnz * M(oneof(2, 3, 4, 5)) / oneof(2, 3, 4, 5, 6)
        LTwice = L * M(oneof(2, 3, 4, 5)) / oneof(2, 3, 4, 5, 6)

        if len(set([L, L2, Lnz, Lnz2, Lflat, Lflat2, L2half, Lnz2half, LnzTwice, LTwice ])) != 10:
            continue

    break
